-
Notifications
You must be signed in to change notification settings - Fork 13
Relative link to MDX files in docs partials #50
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to test this out locally. Can you include a sample page, or link to a page where this is used in your PR Conversation? It would be good to have that added to a comment in the code as well, so other developers can understand what this does / how to use it / why it's there.
* i.e. start realtive paths from the partial file directory, not from place where it is being inserted | ||
* example: | ||
* main file: docs/page/1.mdx | ||
* partial: docs/partials/headers/1.mdx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding these comments: What is the syntax for partials? Maybe indicate this in the comment:
* main file: docs/page/1.mdx
* partial: (!docs/partials/headers/1.mdx!)
* With this utility a partial like
* (!../image.jpg!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for adding the comments!
correct relative paths resolving in partial docs
i.e. start realtive paths from the partial file directory, not from place where it is being inserted
example:
main file:
docs/page/1.mdx
partial:
docs/includes/headers/1.mdx
With this utility path like that
../getting-started
in partial will be pointing to
docs/partials/getting-started
and without:
docs/getting-started